fix(server): stop OpenCode V2 descendant sessions - #9904
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR materially changes production OpenCode lifecycle behavior by recursively aborting descendant sessions during interrupts and external-scope release, including new timeout and error-propagation semantics. An unresolved comment also identifies potential unbounded upstream error data in diagnostics, so the change warrants human review. You can add or adjust custom eligibility rules. Learn more. |
b82facd to
2ac9bfe
Compare
2232091 to
ed4c193
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ed4c193. Configure here.
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
9242b91 to
3d81172
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- Re-route steering that races completion into idempotent follow-up dispatches - Preserve scheduled-task attribution and provider ownership history across clients
Port main's pull-request discovery, active thread ordering, async question dismissal, settlement fixes, provider-session import, attachment context, and provider correctness changes into orchestration v2. Keep the branch's intentional composer and subagent behavior while adopting main's web and mobile fixes. Prevent headless setup terminals from hanging on the color probe, and move the v2 migration block to 050-061 after main claimed 048-049.
Restore the failed-before-start timer guard, align two server fixtures with the reconciled behavior, and remove dead files, exports, and dependencies surfaced by Knip. Drop the temporary branch push trigger now that the PR is mergeable, so each update runs the pull-request workflow once.
Keep main's batch machine-update banner and update action while preserving the v2 runtime-based environment lock used by draft load balancing.
Adopt TypeScript 7 and Effect rc.112 across orchestration v2, including the TaggedError API migration and updated Effect-aware tests. Restore main's composer-aware scroll-to-end clearance while retaining selected-model settings sync, preview recording transfer, image galleries, desktop context menus, and layout hit targets. Regenerate the lockfile on the upgraded dependency baseline.
efd9994 to
6102d00
Compare
Advertise bounded socket snapshots and authoritative dispatch validation, omit raw command output and inline file bodies at the wire boundary, and preserve compact status metadata across web and mobile. Add transport-budget coverage for snapshots, resume, commands, legacy import, and projection maintenance.
25d0f5f to
cd77b23
Compare
This comment has been minimized.
This comment has been minimized.
8187b17 to
ada72ce
Compare

OpenCode child sessions can outlive a root Stop or a released external adapter. Walk and abort known descendants, bound requests with cancellation, attempt siblings after a failure, and surface structured cleanup errors. Missing sessions count as already stopped. External adapter release also cleans up its owned sessions.
Rebuilt on V2
7dd9873ed, including test-only prerequisite #10865 (merge first). Current head5278d0f7d; the topic is ten files including strict replay fixtures. Updated two test clients for the current session metadata read.Validation: 119 adapter, runtime, and orchestrator replay tests pass; server typecheck, targeted lint and formatting pass. New CI pending. Independent Claude Opus 5 high review remains unavailable: direct launcher exited 1 due to expired OAuth before inference.
Targets V2 #2829. Updated with GPT-6 in Codex/T3.
Follow-up review: each descendant request retains a five-second deadline; removed the fixed whole-traversal cutoff so deep trees are fully attempted. New four-level/36-second simulated regression passes; all 27 adapter tests and server typecheck pass on this follow-up. Timeout errors are constructed at the request boundary.
Latest review follow-up: SDK error detail now derives only from operation/status; raw response stays in cause. 41 adapter/runtime tests plus server types/lint pass.